]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
scripting: Use logError to format error stack
authorPhilip Chimento <philip.chimento@gmail.com>
Mon, 1 Jan 2024 00:08:20 +0000 (19:08 -0500)
committerFlorian Müllner <fmuellner@gnome.org>
Thu, 4 Jan 2024 18:59:33 +0000 (18:59 +0000)
Instead of manually formatting the error stack, use logError() to
display the error. logError() displays the stack already.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3041>

js/ui/scripting.js

index db245c0f47ef4fa8b7d67843bcfbf028bbb41123..c38f07d17cfe32bf61108dde5fae45e30a4695ce 100644 (file)
@@ -295,14 +295,14 @@ async function _runPerfScript(scriptModule, outputFile) {
     try {
         await scriptModule.run();
     } catch (err) {
-        log(`Script failed: ${err}\n${err.stack}`);
+        logError(err, 'Script failed');
         Meta.exit(Meta.ExitCode.ERROR);
     }
 
     try {
         _collect(scriptModule, outputFile);
     } catch (err) {
-        log(`Script failed: ${err}\n${err.stack}`);
+        logError(err, 'Script failed');
         Meta.exit(Meta.ExitCode.ERROR);
     }
 
@@ -311,7 +311,7 @@ async function _runPerfScript(scriptModule, outputFile) {
         if (perfHelper._autoExit)
             perfHelper.ExitSync();
     } catch (err) {
-        log(`Failed to exit helper: ${err}\n${err.stack}`);
+        logError(err, 'Failed to exit helper');
         Meta.exit(Meta.ExitCode.ERROR);
     }